package com.netease.pris.activity.view;

import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;

class bi extends GestureDetector.SimpleOnGestureListener
{
  private bi(FlingGallery paramFlingGallery)
  {
  }

  private boolean a(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2)
  {
    int i = 1;
    float f1 = paramMotionEvent2.getX();
    float f2 = paramMotionEvent2.getY();
    int j = (int)Math.abs(f1 - FlingGallery.y(this.a));
    int k = (int)Math.abs(f2 - FlingGallery.z(this.a));
    int m;
    if ((int)Math.abs(paramMotionEvent2.getX() - paramMotionEvent1.getX()) > FlingGallery.A(this.a))
    {
      m = i;
      if ((m == 0) || (k > j))
        break label92;
    }
    while (true)
    {
      return i;
      m = 0;
      break;
      label92: i = 0;
    }
  }

  private boolean a(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat)
  {
    boolean bool1 = true;
    float f1 = paramMotionEvent2.getX();
    float f2 = paramMotionEvent2.getY();
    boolean bool2;
    int k;
    if (paramFloat > 0.0F)
    {
      bool2 = bool1;
      if (FlingGallery.B(this.a) != bool2)
      {
        FlingGallery.e(this.a, bool2);
        FlingGallery.b(this.a, paramMotionEvent2.getX());
        FlingGallery.c(this.a, paramMotionEvent2.getY());
      }
      int i = (int)Math.abs(f1 - FlingGallery.y(this.a));
      int j = (int)Math.abs(f2 - FlingGallery.z(this.a));
      if ((int)Math.abs(paramMotionEvent2.getX() - paramMotionEvent1.getX()) <= FlingGallery.A(this.a))
        break label158;
      k = bool1;
      label130: if ((k == 0) || (j >= 0.5D * i))
        break label164;
    }
    while (true)
    {
      return bool1;
      bool2 = false;
      break;
      label158: k = 0;
      break label130;
      label164: bool1 = false;
    }
  }

  public boolean onDoubleTap(MotionEvent paramMotionEvent)
  {
    boolean bool1 = false;
    if (FlingGallery.G(this.a) != null)
      bool1 = FlingGallery.G(this.a).c();
    if (bool1);
    for (boolean bool2 = true; ; bool2 = super.onDoubleTap(paramMotionEvent))
      return bool2;
  }

  public boolean onDown(MotionEvent paramMotionEvent)
  {
    FlingGallery.b(this.a, false);
    FlingGallery.e(this.a, 0);
    return false;
  }

  public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    int i = 0;
    if (!a(paramMotionEvent1, paramMotionEvent2));
    while (true)
    {
      return i;
      float f = paramMotionEvent2.getX() - paramMotionEvent1.getX();
      (paramMotionEvent2.getY() - paramMotionEvent1.getY());
      if ((paramFloat1 < 0.0F) && ((int)paramFloat1 < -FlingGallery.C(this.a)))
      {
        if (f >= -FlingGallery.D(this.a))
          continue;
        this.a.o();
        i = 1;
        continue;
      }
      if ((paramFloat1 <= 0.0F) || ((int)paramFloat1 <= FlingGallery.C(this.a)) || (f <= FlingGallery.D(this.a)))
        continue;
      this.a.n();
      i = 1;
    }
  }

  public void onLongPress(MotionEvent paramMotionEvent)
  {
    FlingGallery.e(this.a, 0);
    if (FlingGallery.E(this.a) != null)
      FlingGallery.E(this.a).a(paramMotionEvent);
  }

  public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    int i = 0;
    if (paramMotionEvent2.getAction() == 2)
    {
      if (!this.a.a(paramMotionEvent1, paramMotionEvent2, paramFloat1, paramFloat2))
        break label32;
      i = 1;
    }
    while (true)
    {
      return i;
      label32: if (FlingGallery.s(this.a))
      {
        if ((!a(paramMotionEvent1, paramMotionEvent2, paramFloat2)) && (!FlingGallery.t(this.a)))
        {
          FlingGallery.c(this.a, true);
          FlingGallery.b(this.a, false);
          continue;
        }
        FlingGallery.d(this.a, true);
      }
      if (!FlingGallery.r(this.a))
      {
        FlingGallery.b(this.a, false);
        FlingGallery.c(this.a, true);
        FlingGallery.e(this.a, 0);
        FlingGallery.a(this.a, System.currentTimeMillis());
        FlingGallery.a(this.a, FlingGallery.f(this.a)[FlingGallery.k(this.a)].c());
      }
      float f1 = FlingGallery.u(this.a) / (FlingGallery.n(this.a) / 1000.0F) * ((float)(System.currentTimeMillis() - FlingGallery.v(this.a)) / 1000.0F);
      float f2 = paramMotionEvent1.getX() - paramMotionEvent2.getX();
      int j;
      if (f2 < f1 * -1.0F)
      {
        f1 *= -1.0F;
        j = Math.round(f1 + FlingGallery.w(this.a));
        if (!FlingGallery.x(this.a))
        {
          if ((FlingGallery.b(this.a) != this.a.i()) || (f1 <= 0.0F))
            break label418;
          if (j > 0)
            j = 0;
        }
        label292: if (j < FlingGallery.u(this.a))
          break label453;
        j = FlingGallery.u(this.a);
      }
      while (true)
      {
        for (int k = 0; k < 3; k++)
        {
          if (((f1 >= 0.0F) || (k == FlingGallery.a(this.a, FlingGallery.k(this.a)))) && ((f1 <= 0.0F) || (k == FlingGallery.b(this.a, FlingGallery.k(this.a)))))
            continue;
          FlingGallery.f(this.a)[k].a(j, 0, FlingGallery.k(this.a));
        }
        if (f2 > f1)
          break;
        f1 = f2;
        break;
        label418: if ((FlingGallery.b(this.a) != this.a.h()) || (f1 >= 0.0F) || (j >= 0))
          break label292;
        j = 0;
        break label292;
        label453: if (j > -1 * FlingGallery.u(this.a))
          continue;
        j = -1 * FlingGallery.u(this.a);
      }
      i = 1;
    }
  }

  public void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    boolean bool = false;
    FlingGallery.e(this.a, 0);
    if (FlingGallery.F(this.a) != null)
      bool = FlingGallery.F(this.a).d();
    return bool;
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.bi
 * JD-Core Version:    0.6.0
 */